{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Importing PulP solver\n",
    "from pulp import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Demand points\n",
    "demand_points=['Port of Haifa','Port of King Abdul Aziz','Port of Jebel Ali']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Port of Haifa', 'Port of King Abdul Aziz', 'Port of Jebel Ali']"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "demand_points"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Supply Points\n",
    "supply_points=['Port of Santos','Port of Montreal','Port of Vancouver','Port of Shanghai','Port of Marseille','Port of Bandar Abbas','Port of Haifa','Port of Aktau','Port of Busan','Penang Port','Port of Oslo','Port of Vladivostok','Port of Novorossiysk','Port of St. Petersburg','Port of Belgrade','Port of Mersin','Port of Odessa','Port of New York','Port of Los Angeles']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Port of Santos',\n",
       " 'Port of Montreal',\n",
       " 'Port of Vancouver',\n",
       " 'Port of Shanghai',\n",
       " 'Port of Marseille',\n",
       " 'Port of Bandar Abbas',\n",
       " 'Port of Haifa',\n",
       " 'Port of Aktau',\n",
       " 'Port of Busan',\n",
       " 'Penang Port',\n",
       " 'Port of Oslo',\n",
       " 'Port of Vladivostok',\n",
       " 'Port of Novorossiysk',\n",
       " 'Port of St. Petersburg',\n",
       " 'Port of Belgrade',\n",
       " 'Port of Mersin',\n",
       " 'Port of Odessa',\n",
       " 'Port of New York',\n",
       " 'Port of Los Angeles']"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "supply_points"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the distances\n",
    "distance = dict(zip(supply_points,[dict(zip(demand_points, [7667,9716,9407])),\n",
    "dict(zip(demand_points, [6336,9778,9470])),\n",
    "dict(zip(demand_points, [12461,10668,10440])),\n",
    "dict(zip(demand_points, [8336,6922,6627])),\n",
    "dict(zip(demand_points, [1946,5388,5080])),\n",
    "dict(zip(demand_points, [3310,365,173])),\n",
    "dict(zip(demand_points, [0,3674,3366])),\n",
    "dict(zip(demand_points, [2201,5301,5094])),\n",
    "dict(zip(demand_points, [8852,7438,7143])),\n",
    "dict(zip(demand_points, [5310,3896,3601])),\n",
    "dict(zip(demand_points, [4539,7981,7673])),\n",
    "dict(zip(demand_points, [9435,8022,7727])),\n",
    "dict(zip(demand_points, [1715,5193,4885])),\n",
    "dict(zip(demand_points, [5398,8841,8532])),\n",
    "dict(zip(demand_points, [1994,5470,5162])),\n",
    "dict(zip(demand_points, [233,3885,3576])),\n",
    "dict(zip(demand_points, [1533,5011,4703])),\n",
    "dict(zip(demand_points, [5756,9222,8918])),\n",
    "dict(zip(demand_points, [11048,11344,11116]))]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of Santos': {'Port of Haifa': 7667,\n",
       "  'Port of King Abdul Aziz': 9716,\n",
       "  'Port of Jebel Ali': 9407},\n",
       " 'Port of Montreal': {'Port of Haifa': 6336,\n",
       "  'Port of King Abdul Aziz': 9778,\n",
       "  'Port of Jebel Ali': 9470},\n",
       " 'Port of Vancouver': {'Port of Haifa': 12461,\n",
       "  'Port of King Abdul Aziz': 10668,\n",
       "  'Port of Jebel Ali': 10440},\n",
       " 'Port of Shanghai': {'Port of Haifa': 8336,\n",
       "  'Port of King Abdul Aziz': 6922,\n",
       "  'Port of Jebel Ali': 6627},\n",
       " 'Port of Marseille': {'Port of Haifa': 1946,\n",
       "  'Port of King Abdul Aziz': 5388,\n",
       "  'Port of Jebel Ali': 5080},\n",
       " 'Port of Bandar Abbas': {'Port of Haifa': 3310,\n",
       "  'Port of King Abdul Aziz': 365,\n",
       "  'Port of Jebel Ali': 173},\n",
       " 'Port of Haifa': {'Port of Haifa': 0,\n",
       "  'Port of King Abdul Aziz': 3674,\n",
       "  'Port of Jebel Ali': 3366},\n",
       " 'Port of Aktau': {'Port of Haifa': 2201,\n",
       "  'Port of King Abdul Aziz': 5301,\n",
       "  'Port of Jebel Ali': 5094},\n",
       " 'Port of Busan': {'Port of Haifa': 8852,\n",
       "  'Port of King Abdul Aziz': 7438,\n",
       "  'Port of Jebel Ali': 7143},\n",
       " 'Penang Port': {'Port of Haifa': 5310,\n",
       "  'Port of King Abdul Aziz': 3896,\n",
       "  'Port of Jebel Ali': 3601},\n",
       " 'Port of Oslo': {'Port of Haifa': 4539,\n",
       "  'Port of King Abdul Aziz': 7981,\n",
       "  'Port of Jebel Ali': 7673},\n",
       " 'Port of Vladivostok': {'Port of Haifa': 9435,\n",
       "  'Port of King Abdul Aziz': 8022,\n",
       "  'Port of Jebel Ali': 7727},\n",
       " 'Port of Novorossiysk': {'Port of Haifa': 1715,\n",
       "  'Port of King Abdul Aziz': 5193,\n",
       "  'Port of Jebel Ali': 4885},\n",
       " 'Port of St. Petersburg': {'Port of Haifa': 5398,\n",
       "  'Port of King Abdul Aziz': 8841,\n",
       "  'Port of Jebel Ali': 8532},\n",
       " 'Port of Belgrade': {'Port of Haifa': 1994,\n",
       "  'Port of King Abdul Aziz': 5470,\n",
       "  'Port of Jebel Ali': 5162},\n",
       " 'Port of Mersin': {'Port of Haifa': 233,\n",
       "  'Port of King Abdul Aziz': 3885,\n",
       "  'Port of Jebel Ali': 3576},\n",
       " 'Port of Odessa': {'Port of Haifa': 1533,\n",
       "  'Port of King Abdul Aziz': 5011,\n",
       "  'Port of Jebel Ali': 4703},\n",
       " 'Port of New York': {'Port of Haifa': 5756,\n",
       "  'Port of King Abdul Aziz': 9222,\n",
       "  'Port of Jebel Ali': 8918},\n",
       " 'Port of Los Angeles': {'Port of Haifa': 11048,\n",
       "  'Port of King Abdul Aziz': 11344,\n",
       "  'Port of Jebel Ali': 11116}}"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "distance"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Magnesium Demand\n",
    "magnesium_demand=dict(zip(demand_points, [126667931.3,146051985.5,138667973.3]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of Haifa': 126667931.3,\n",
       " 'Port of King Abdul Aziz': 146051985.5,\n",
       " 'Port of Jebel Ali': 138667973.3}"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "magnesium_demand"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Magnesium Supply\n",
    "magnesium_supply=dict(zip(supply_points, [4204466.2090,1222172.6320,363811.2924,298590444.7000,2010234.6250,1585983.9250,7566106.3450,6113002.8630,4078244.4230,47579.5177,5189339.4020,9195220.1200,4484984.5940,4536578.4990,379084.0981,3324539.5030,41313949.6100,10124868.6300,7057279.1490])) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of Santos': 4204466.209,\n",
       " 'Port of Montreal': 1222172.632,\n",
       " 'Port of Vancouver': 363811.2924,\n",
       " 'Port of Shanghai': 298590444.7,\n",
       " 'Port of Marseille': 2010234.625,\n",
       " 'Port of Bandar Abbas': 1585983.925,\n",
       " 'Port of Haifa': 7566106.345,\n",
       " 'Port of Aktau': 6113002.863,\n",
       " 'Port of Busan': 4078244.423,\n",
       " 'Penang Port': 47579.5177,\n",
       " 'Port of Oslo': 5189339.402,\n",
       " 'Port of Vladivostok': 9195220.12,\n",
       " 'Port of Novorossiysk': 4484984.594,\n",
       " 'Port of St. Petersburg': 4536578.499,\n",
       " 'Port of Belgrade': 379084.0981,\n",
       " 'Port of Mersin': 3324539.503,\n",
       " 'Port of Odessa': 41313949.61,\n",
       " 'Port of New York': 10124868.63,\n",
       " 'Port of Los Angeles': 7057279.149}"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "magnesium_supply"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Set Problem Variables\n",
    "prob = LpProblem(\"Transportation\", LpMinimize)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "None\n",
       "VARIABLES"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Set Problem Variables\n",
    "routes = [(i,j) for i in supply_points for j in demand_points]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('Port of Santos', 'Port of Haifa'),\n",
       " ('Port of Santos', 'Port of King Abdul Aziz'),\n",
       " ('Port of Santos', 'Port of Jebel Ali'),\n",
       " ('Port of Montreal', 'Port of Haifa'),\n",
       " ('Port of Montreal', 'Port of King Abdul Aziz'),\n",
       " ('Port of Montreal', 'Port of Jebel Ali'),\n",
       " ('Port of Vancouver', 'Port of Haifa'),\n",
       " ('Port of Vancouver', 'Port of King Abdul Aziz'),\n",
       " ('Port of Vancouver', 'Port of Jebel Ali'),\n",
       " ('Port of Shanghai', 'Port of Haifa'),\n",
       " ('Port of Shanghai', 'Port of King Abdul Aziz'),\n",
       " ('Port of Shanghai', 'Port of Jebel Ali'),\n",
       " ('Port of Marseille', 'Port of Haifa'),\n",
       " ('Port of Marseille', 'Port of King Abdul Aziz'),\n",
       " ('Port of Marseille', 'Port of Jebel Ali'),\n",
       " ('Port of Bandar Abbas', 'Port of Haifa'),\n",
       " ('Port of Bandar Abbas', 'Port of King Abdul Aziz'),\n",
       " ('Port of Bandar Abbas', 'Port of Jebel Ali'),\n",
       " ('Port of Haifa', 'Port of Haifa'),\n",
       " ('Port of Haifa', 'Port of King Abdul Aziz'),\n",
       " ('Port of Haifa', 'Port of Jebel Ali'),\n",
       " ('Port of Aktau', 'Port of Haifa'),\n",
       " ('Port of Aktau', 'Port of King Abdul Aziz'),\n",
       " ('Port of Aktau', 'Port of Jebel Ali'),\n",
       " ('Port of Busan', 'Port of Haifa'),\n",
       " ('Port of Busan', 'Port of King Abdul Aziz'),\n",
       " ('Port of Busan', 'Port of Jebel Ali'),\n",
       " ('Penang Port', 'Port of Haifa'),\n",
       " ('Penang Port', 'Port of King Abdul Aziz'),\n",
       " ('Penang Port', 'Port of Jebel Ali'),\n",
       " ('Port of Oslo', 'Port of Haifa'),\n",
       " ('Port of Oslo', 'Port of King Abdul Aziz'),\n",
       " ('Port of Oslo', 'Port of Jebel Ali'),\n",
       " ('Port of Vladivostok', 'Port of Haifa'),\n",
       " ('Port of Vladivostok', 'Port of King Abdul Aziz'),\n",
       " ('Port of Vladivostok', 'Port of Jebel Ali'),\n",
       " ('Port of Novorossiysk', 'Port of Haifa'),\n",
       " ('Port of Novorossiysk', 'Port of King Abdul Aziz'),\n",
       " ('Port of Novorossiysk', 'Port of Jebel Ali'),\n",
       " ('Port of St. Petersburg', 'Port of Haifa'),\n",
       " ('Port of St. Petersburg', 'Port of King Abdul Aziz'),\n",
       " ('Port of St. Petersburg', 'Port of Jebel Ali'),\n",
       " ('Port of Belgrade', 'Port of Haifa'),\n",
       " ('Port of Belgrade', 'Port of King Abdul Aziz'),\n",
       " ('Port of Belgrade', 'Port of Jebel Ali'),\n",
       " ('Port of Mersin', 'Port of Haifa'),\n",
       " ('Port of Mersin', 'Port of King Abdul Aziz'),\n",
       " ('Port of Mersin', 'Port of Jebel Ali'),\n",
       " ('Port of Odessa', 'Port of Haifa'),\n",
       " ('Port of Odessa', 'Port of King Abdul Aziz'),\n",
       " ('Port of Odessa', 'Port of Jebel Ali'),\n",
       " ('Port of New York', 'Port of Haifa'),\n",
       " ('Port of New York', 'Port of King Abdul Aziz'),\n",
       " ('Port of New York', 'Port of Jebel Ali'),\n",
       " ('Port of Los Angeles', 'Port of Haifa'),\n",
       " ('Port of Los Angeles', 'Port of King Abdul Aziz'),\n",
       " ('Port of Los Angeles', 'Port of Jebel Ali')]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "routes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Decision Variables\n",
    "X = LpVariable.dicts(\"ShipmentAmount\",(supply_points, demand_points),0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of Santos': {'Port of Haifa': ShipmentAmount_Port_of_Santos_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali},\n",
       " 'Port of Montreal': {'Port of Haifa': ShipmentAmount_Port_of_Montreal_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Montreal_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Montreal_Port_of_Jebel_Ali},\n",
       " 'Port of Vancouver': {'Port of Haifa': ShipmentAmount_Port_of_Vancouver_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Vancouver_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Vancouver_Port_of_Jebel_Ali},\n",
       " 'Port of Shanghai': {'Port of Haifa': ShipmentAmount_Port_of_Shanghai_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali},\n",
       " 'Port of Marseille': {'Port of Haifa': ShipmentAmount_Port_of_Marseille_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali},\n",
       " 'Port of Bandar Abbas': {'Port of Haifa': ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Bandar_Abbas_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Jebel_Ali},\n",
       " 'Port of Haifa': {'Port of Haifa': ShipmentAmount_Port_of_Haifa_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Haifa_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Haifa_Port_of_Jebel_Ali},\n",
       " 'Port of Aktau': {'Port of Haifa': ShipmentAmount_Port_of_Aktau_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Aktau_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Aktau_Port_of_Jebel_Ali},\n",
       " 'Port of Busan': {'Port of Haifa': ShipmentAmount_Port_of_Busan_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali},\n",
       " 'Penang Port': {'Port of Haifa': ShipmentAmount_Penang_Port_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Penang_Port_Port_of_Jebel_Ali},\n",
       " 'Port of Oslo': {'Port of Haifa': ShipmentAmount_Port_of_Oslo_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Oslo_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Oslo_Port_of_Jebel_Ali},\n",
       " 'Port of Vladivostok': {'Port of Haifa': ShipmentAmount_Port_of_Vladivostok_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Vladivostok_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Vladivostok_Port_of_Jebel_Ali},\n",
       " 'Port of Novorossiysk': {'Port of Haifa': ShipmentAmount_Port_of_Novorossiysk_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Novorossiysk_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Novorossiysk_Port_of_Jebel_Ali},\n",
       " 'Port of St. Petersburg': {'Port of Haifa': ShipmentAmount_Port_of_St._Petersburg_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_St._Petersburg_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_St._Petersburg_Port_of_Jebel_Ali},\n",
       " 'Port of Belgrade': {'Port of Haifa': ShipmentAmount_Port_of_Belgrade_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Belgrade_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Belgrade_Port_of_Jebel_Ali},\n",
       " 'Port of Mersin': {'Port of Haifa': ShipmentAmount_Port_of_Mersin_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali},\n",
       " 'Port of Odessa': {'Port of Haifa': ShipmentAmount_Port_of_Odessa_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Odessa_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Odessa_Port_of_Jebel_Ali},\n",
       " 'Port of New York': {'Port of Haifa': ShipmentAmount_Port_of_New_York_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali},\n",
       " 'Port of Los Angeles': {'Port of Haifa': ShipmentAmount_Port_of_Los_Angeles_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali}}"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Objective Function\n",
    "prob += sum(X[i][j]*distance[i][j] for (i,j) in routes)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "5310*ShipmentAmount_Penang_Port_Port_of_Haifa + 3601*ShipmentAmount_Penang_Port_Port_of_Jebel_Ali + 3896*ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz + 2201*ShipmentAmount_Port_of_Aktau_Port_of_Haifa + 5094*ShipmentAmount_Port_of_Aktau_Port_of_Jebel_Ali + 5301*ShipmentAmount_Port_of_Aktau_Port_of_King_Abdul_Aziz + 3310*ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Haifa + 173*ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Jebel_Ali + 365*ShipmentAmount_Port_of_Bandar_Abbas_Port_of_King_Abdul_Aziz + 1994*ShipmentAmount_Port_of_Belgrade_Port_of_Haifa + 5162*ShipmentAmount_Port_of_Belgrade_Port_of_Jebel_Ali + 5470*ShipmentAmount_Port_of_Belgrade_Port_of_King_Abdul_Aziz + 8852*ShipmentAmount_Port_of_Busan_Port_of_Haifa + 7143*ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali + 7438*ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz + 3366*ShipmentAmount_Port_of_Haifa_Port_of_Jebel_Ali + 3674*ShipmentAmount_Port_of_Haifa_Port_of_King_Abdul_Aziz + 11048*ShipmentAmount_Port_of_Los_Angeles_Port_of_Haifa + 11116*ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali + 11344*ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz + 1946*ShipmentAmount_Port_of_Marseille_Port_of_Haifa + 5080*ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali + 5388*ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz + 233*ShipmentAmount_Port_of_Mersin_Port_of_Haifa + 3576*ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali + 3885*ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz + 6336*ShipmentAmount_Port_of_Montreal_Port_of_Haifa + 9470*ShipmentAmount_Port_of_Montreal_Port_of_Jebel_Ali + 9778*ShipmentAmount_Port_of_Montreal_Port_of_King_Abdul_Aziz + 5756*ShipmentAmount_Port_of_New_York_Port_of_Haifa + 8918*ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali + 9222*ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz + 1715*ShipmentAmount_Port_of_Novorossiysk_Port_of_Haifa + 4885*ShipmentAmount_Port_of_Novorossiysk_Port_of_Jebel_Ali + 5193*ShipmentAmount_Port_of_Novorossiysk_Port_of_King_Abdul_Aziz + 1533*ShipmentAmount_Port_of_Odessa_Port_of_Haifa + 4703*ShipmentAmount_Port_of_Odessa_Port_of_Jebel_Ali + 5011*ShipmentAmount_Port_of_Odessa_Port_of_King_Abdul_Aziz + 4539*ShipmentAmount_Port_of_Oslo_Port_of_Haifa + 7673*ShipmentAmount_Port_of_Oslo_Port_of_Jebel_Ali + 7981*ShipmentAmount_Port_of_Oslo_Port_of_King_Abdul_Aziz + 7667*ShipmentAmount_Port_of_Santos_Port_of_Haifa + 9407*ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali + 9716*ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz + 8336*ShipmentAmount_Port_of_Shanghai_Port_of_Haifa + 6627*ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali + 6922*ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz + 5398*ShipmentAmount_Port_of_St._Petersburg_Port_of_Haifa + 8532*ShipmentAmount_Port_of_St._Petersburg_Port_of_Jebel_Ali + 8841*ShipmentAmount_Port_of_St._Petersburg_Port_of_King_Abdul_Aziz + 12461*ShipmentAmount_Port_of_Vancouver_Port_of_Haifa + 10440*ShipmentAmount_Port_of_Vancouver_Port_of_Jebel_Ali + 10668*ShipmentAmount_Port_of_Vancouver_Port_of_King_Abdul_Aziz + 9435*ShipmentAmount_Port_of_Vladivostok_Port_of_Haifa + 7727*ShipmentAmount_Port_of_Vladivostok_Port_of_Jebel_Ali + 8022*ShipmentAmount_Port_of_Vladivostok_Port_of_King_Abdul_Aziz + 0\n",
       "VARIABLES\n",
       "ShipmentAmount_Penang_Port_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Aktau_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Aktau_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Aktau_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Bandar_Abbas_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Belgrade_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Belgrade_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Belgrade_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Haifa_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Haifa_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Montreal_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Montreal_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Montreal_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Novorossiysk_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Novorossiysk_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Novorossiysk_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Odessa_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Odessa_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Odessa_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Oslo_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Oslo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Oslo_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_St._Petersburg_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_St._Petersburg_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_St._Petersburg_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Vancouver_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Vancouver_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Vancouver_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Vladivostok_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Vladivostok_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Vladivostok_Port_of_King_Abdul_Aziz Continuous"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "5310*ShipmentAmount_Penang_Port_Port_of_Haifa + 3601*ShipmentAmount_Penang_Port_Port_of_Jebel_Ali + 3896*ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz + 2201*ShipmentAmount_Port_of_Aktau_Port_of_Haifa + 5094*ShipmentAmount_Port_of_Aktau_Port_of_Jebel_Ali + 5301*ShipmentAmount_Port_of_Aktau_Port_of_King_Abdul_Aziz + 3310*ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Haifa + 173*ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Jebel_Ali + 365*ShipmentAmount_Port_of_Bandar_Abbas_Port_of_King_Abdul_Aziz + 1994*ShipmentAmount_Port_of_Belgrade_Port_of_Haifa + 5162*ShipmentAmount_Port_of_Belgrade_Port_of_Jebel_Ali + 5470*ShipmentAmount_Port_of_Belgrade_Port_of_King_Abdul_Aziz + 8852*ShipmentAmount_Port_of_Busan_Port_of_Haifa + 7143*ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali + 7438*ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz + 3366*ShipmentAmount_Port_of_Haifa_Port_of_Jebel_Ali + 3674*ShipmentAmount_Port_of_Haifa_Port_of_King_Abdul_Aziz + 11048*ShipmentAmount_Port_of_Los_Angeles_Port_of_Haifa + 11116*ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali + 11344*ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz + 1946*ShipmentAmount_Port_of_Marseille_Port_of_Haifa + 5080*ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali + 5388*ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz + 233*ShipmentAmount_Port_of_Mersin_Port_of_Haifa + 3576*ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali + 3885*ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz + 6336*ShipmentAmount_Port_of_Montreal_Port_of_Haifa + 9470*ShipmentAmount_Port_of_Montreal_Port_of_Jebel_Ali + 9778*ShipmentAmount_Port_of_Montreal_Port_of_King_Abdul_Aziz + 5756*ShipmentAmount_Port_of_New_York_Port_of_Haifa + 8918*ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali + 9222*ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz + 1715*ShipmentAmount_Port_of_Novorossiysk_Port_of_Haifa + 4885*ShipmentAmount_Port_of_Novorossiysk_Port_of_Jebel_Ali + 5193*ShipmentAmount_Port_of_Novorossiysk_Port_of_King_Abdul_Aziz + 1533*ShipmentAmount_Port_of_Odessa_Port_of_Haifa + 4703*ShipmentAmount_Port_of_Odessa_Port_of_Jebel_Ali + 5011*ShipmentAmount_Port_of_Odessa_Port_of_King_Abdul_Aziz + 4539*ShipmentAmount_Port_of_Oslo_Port_of_Haifa + 7673*ShipmentAmount_Port_of_Oslo_Port_of_Jebel_Ali + 7981*ShipmentAmount_Port_of_Oslo_Port_of_King_Abdul_Aziz + 7667*ShipmentAmount_Port_of_Santos_Port_of_Haifa + 9407*ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali + 9716*ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz + 8336*ShipmentAmount_Port_of_Shanghai_Port_of_Haifa + 6627*ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali + 6922*ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz + 5398*ShipmentAmount_Port_of_St._Petersburg_Port_of_Haifa + 8532*ShipmentAmount_Port_of_St._Petersburg_Port_of_Jebel_Ali + 8841*ShipmentAmount_Port_of_St._Petersburg_Port_of_King_Abdul_Aziz + 12461*ShipmentAmount_Port_of_Vancouver_Port_of_Haifa + 10440*ShipmentAmount_Port_of_Vancouver_Port_of_Jebel_Ali + 10668*ShipmentAmount_Port_of_Vancouver_Port_of_King_Abdul_Aziz + 9435*ShipmentAmount_Port_of_Vladivostok_Port_of_Haifa + 7727*ShipmentAmount_Port_of_Vladivostok_Port_of_Jebel_Ali + 8022*ShipmentAmount_Port_of_Vladivostok_Port_of_King_Abdul_Aziz + 0\n",
       "SUBJECT TO\n",
       "_C1: ShipmentAmount_Penang_Port_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Aktau_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Belgrade_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Haifa_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Mersin_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Montreal_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Novorossiysk_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Odessa_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Oslo_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_St._Petersburg_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Vancouver_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Vladivostok_Port_of_Haifa >= 126667931.3\n",
       "\n",
       "_C2: ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Aktau_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Bandar_Abbas_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Belgrade_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Haifa_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Montreal_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Novorossiysk_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Odessa_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Oslo_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_St._Petersburg_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Vancouver_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Vladivostok_Port_of_King_Abdul_Aziz >= 146051985.5\n",
       "\n",
       "_C3: ShipmentAmount_Penang_Port_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Aktau_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Belgrade_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Haifa_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Montreal_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Novorossiysk_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Odessa_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Oslo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_St._Petersburg_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Vancouver_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Vladivostok_Port_of_Jebel_Ali >= 138667973.3\n",
       "\n",
       "VARIABLES\n",
       "ShipmentAmount_Penang_Port_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Aktau_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Aktau_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Aktau_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Bandar_Abbas_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Belgrade_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Belgrade_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Belgrade_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Haifa_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Haifa_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Haifa_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Montreal_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Montreal_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Montreal_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Novorossiysk_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Novorossiysk_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Novorossiysk_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Odessa_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Odessa_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Odessa_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Oslo_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Oslo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Oslo_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_St._Petersburg_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_St._Petersburg_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_St._Petersburg_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Vancouver_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Vancouver_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Vancouver_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Vladivostok_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Vladivostok_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Vladivostok_Port_of_King_Abdul_Aziz Continuous"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Constraints\n",
    "for j in demand_points:\n",
    "    prob += sum(X[i][j] for i in supply_points) >= magnesium_demand[j]\n",
    "    \n",
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "5310*ShipmentAmount_Penang_Port_Port_of_Haifa + 3601*ShipmentAmount_Penang_Port_Port_of_Jebel_Ali + 3896*ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz + 2201*ShipmentAmount_Port_of_Aktau_Port_of_Haifa + 5094*ShipmentAmount_Port_of_Aktau_Port_of_Jebel_Ali + 5301*ShipmentAmount_Port_of_Aktau_Port_of_King_Abdul_Aziz + 3310*ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Haifa + 173*ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Jebel_Ali + 365*ShipmentAmount_Port_of_Bandar_Abbas_Port_of_King_Abdul_Aziz + 1994*ShipmentAmount_Port_of_Belgrade_Port_of_Haifa + 5162*ShipmentAmount_Port_of_Belgrade_Port_of_Jebel_Ali + 5470*ShipmentAmount_Port_of_Belgrade_Port_of_King_Abdul_Aziz + 8852*ShipmentAmount_Port_of_Busan_Port_of_Haifa + 7143*ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali + 7438*ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz + 3366*ShipmentAmount_Port_of_Haifa_Port_of_Jebel_Ali + 3674*ShipmentAmount_Port_of_Haifa_Port_of_King_Abdul_Aziz + 11048*ShipmentAmount_Port_of_Los_Angeles_Port_of_Haifa + 11116*ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali + 11344*ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz + 1946*ShipmentAmount_Port_of_Marseille_Port_of_Haifa + 5080*ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali + 5388*ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz + 233*ShipmentAmount_Port_of_Mersin_Port_of_Haifa + 3576*ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali + 3885*ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz + 6336*ShipmentAmount_Port_of_Montreal_Port_of_Haifa + 9470*ShipmentAmount_Port_of_Montreal_Port_of_Jebel_Ali + 9778*ShipmentAmount_Port_of_Montreal_Port_of_King_Abdul_Aziz + 5756*ShipmentAmount_Port_of_New_York_Port_of_Haifa + 8918*ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali + 9222*ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz + 1715*ShipmentAmount_Port_of_Novorossiysk_Port_of_Haifa + 4885*ShipmentAmount_Port_of_Novorossiysk_Port_of_Jebel_Ali + 5193*ShipmentAmount_Port_of_Novorossiysk_Port_of_King_Abdul_Aziz + 1533*ShipmentAmount_Port_of_Odessa_Port_of_Haifa + 4703*ShipmentAmount_Port_of_Odessa_Port_of_Jebel_Ali + 5011*ShipmentAmount_Port_of_Odessa_Port_of_King_Abdul_Aziz + 4539*ShipmentAmount_Port_of_Oslo_Port_of_Haifa + 7673*ShipmentAmount_Port_of_Oslo_Port_of_Jebel_Ali + 7981*ShipmentAmount_Port_of_Oslo_Port_of_King_Abdul_Aziz + 7667*ShipmentAmount_Port_of_Santos_Port_of_Haifa + 9407*ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali + 9716*ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz + 8336*ShipmentAmount_Port_of_Shanghai_Port_of_Haifa + 6627*ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali + 6922*ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz + 5398*ShipmentAmount_Port_of_St._Petersburg_Port_of_Haifa + 8532*ShipmentAmount_Port_of_St._Petersburg_Port_of_Jebel_Ali + 8841*ShipmentAmount_Port_of_St._Petersburg_Port_of_King_Abdul_Aziz + 12461*ShipmentAmount_Port_of_Vancouver_Port_of_Haifa + 10440*ShipmentAmount_Port_of_Vancouver_Port_of_Jebel_Ali + 10668*ShipmentAmount_Port_of_Vancouver_Port_of_King_Abdul_Aziz + 9435*ShipmentAmount_Port_of_Vladivostok_Port_of_Haifa + 7727*ShipmentAmount_Port_of_Vladivostok_Port_of_Jebel_Ali + 8022*ShipmentAmount_Port_of_Vladivostok_Port_of_King_Abdul_Aziz + 0\n",
       "SUBJECT TO\n",
       "_C1: ShipmentAmount_Penang_Port_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Aktau_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Belgrade_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Haifa_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Mersin_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Montreal_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Novorossiysk_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Odessa_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Oslo_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_St._Petersburg_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Vancouver_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Vladivostok_Port_of_Haifa >= 126667931.3\n",
       "\n",
       "_C2: ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Aktau_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Bandar_Abbas_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Belgrade_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Haifa_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Montreal_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Novorossiysk_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Odessa_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Oslo_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_St._Petersburg_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Vancouver_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Vladivostok_Port_of_King_Abdul_Aziz >= 146051985.5\n",
       "\n",
       "_C3: ShipmentAmount_Penang_Port_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Aktau_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Belgrade_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Haifa_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Montreal_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Novorossiysk_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Odessa_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Oslo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_St._Petersburg_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Vancouver_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Vladivostok_Port_of_Jebel_Ali >= 138667973.3\n",
       "\n",
       "_C4: ShipmentAmount_Port_of_Santos_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz = 4204466.209\n",
       "\n",
       "_C5: ShipmentAmount_Port_of_Montreal_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Montreal_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Montreal_Port_of_King_Abdul_Aziz = 1222172.632\n",
       "\n",
       "_C6: ShipmentAmount_Port_of_Vancouver_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Vancouver_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Vancouver_Port_of_King_Abdul_Aziz = 363811.2924\n",
       "\n",
       "_C7: ShipmentAmount_Port_of_Shanghai_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz = 298590444.7\n",
       "\n",
       "_C8: ShipmentAmount_Port_of_Marseille_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz = 2010234.625\n",
       "\n",
       "_C9: ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Bandar_Abbas_Port_of_King_Abdul_Aziz = 1585983.925\n",
       "\n",
       "_C10: ShipmentAmount_Port_of_Haifa_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Haifa_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Haifa_Port_of_King_Abdul_Aziz = 7566106.345\n",
       "\n",
       "_C11: ShipmentAmount_Port_of_Aktau_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Aktau_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Aktau_Port_of_King_Abdul_Aziz = 6113002.863\n",
       "\n",
       "_C12: ShipmentAmount_Port_of_Busan_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz = 4078244.423\n",
       "\n",
       "_C13: ShipmentAmount_Penang_Port_Port_of_Haifa\n",
       " + ShipmentAmount_Penang_Port_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz = 47579.5177\n",
       "\n",
       "_C14: ShipmentAmount_Port_of_Oslo_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Oslo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Oslo_Port_of_King_Abdul_Aziz = 5189339.402\n",
       "\n",
       "_C15: ShipmentAmount_Port_of_Vladivostok_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Vladivostok_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Vladivostok_Port_of_King_Abdul_Aziz = 9195220.12\n",
       "\n",
       "_C16: ShipmentAmount_Port_of_Novorossiysk_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Novorossiysk_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Novorossiysk_Port_of_King_Abdul_Aziz = 4484984.594\n",
       "\n",
       "_C17: ShipmentAmount_Port_of_St._Petersburg_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_St._Petersburg_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_St._Petersburg_Port_of_King_Abdul_Aziz = 4536578.499\n",
       "\n",
       "_C18: ShipmentAmount_Port_of_Belgrade_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Belgrade_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Belgrade_Port_of_King_Abdul_Aziz = 379084.0981\n",
       "\n",
       "_C19: ShipmentAmount_Port_of_Mersin_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz = 3324539.503\n",
       "\n",
       "_C20: ShipmentAmount_Port_of_Odessa_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Odessa_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Odessa_Port_of_King_Abdul_Aziz = 41313949.61\n",
       "\n",
       "_C21: ShipmentAmount_Port_of_New_York_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz = 10124868.63\n",
       "\n",
       "_C22: ShipmentAmount_Port_of_Los_Angeles_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz = 7057279.149\n",
       "\n",
       "VARIABLES\n",
       "ShipmentAmount_Penang_Port_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Aktau_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Aktau_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Aktau_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Bandar_Abbas_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Belgrade_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Belgrade_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Belgrade_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Haifa_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Haifa_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Haifa_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Montreal_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Montreal_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Montreal_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Novorossiysk_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Novorossiysk_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Novorossiysk_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Odessa_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Odessa_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Odessa_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Oslo_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Oslo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Oslo_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_St._Petersburg_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_St._Petersburg_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_St._Petersburg_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Vancouver_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Vancouver_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Vancouver_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Vladivostok_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Vladivostok_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Vladivostok_Port_of_King_Abdul_Aziz Continuous"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Constraints\n",
    "for i in supply_points:\n",
    "    prob += sum(X[i][j] for j in demand_points) == magnesium_supply[i]\n",
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Status: Optimal\n",
      "ShipmentAmount_Penang_Port_Port_of_Haifa = 47579.518\n",
      "ShipmentAmount_Port_of_Aktau_Port_of_Haifa = 6113002.9\n",
      "ShipmentAmount_Port_of_Bandar_Abbas_Port_of_King_Abdul_Aziz = 1585983.9\n",
      "ShipmentAmount_Port_of_Belgrade_Port_of_Haifa = 379084.1\n",
      "ShipmentAmount_Port_of_Busan_Port_of_Haifa = 4078244.4\n",
      "ShipmentAmount_Port_of_Haifa_Port_of_Haifa = 7566106.3\n",
      "ShipmentAmount_Port_of_Los_Angeles_Port_of_Haifa = 7057279.1\n",
      "ShipmentAmount_Port_of_Marseille_Port_of_Haifa = 2010234.6\n",
      "ShipmentAmount_Port_of_Mersin_Port_of_Haifa = 3324539.5\n",
      "ShipmentAmount_Port_of_Montreal_Port_of_Haifa = 1222172.6\n",
      "ShipmentAmount_Port_of_New_York_Port_of_Haifa = 10124869.0\n",
      "ShipmentAmount_Port_of_Novorossiysk_Port_of_Haifa = 4484984.6\n",
      "ShipmentAmount_Port_of_Odessa_Port_of_Haifa = 41313950.0\n",
      "ShipmentAmount_Port_of_Oslo_Port_of_Haifa = 5189339.4\n",
      "ShipmentAmount_Port_of_Santos_Port_of_Haifa = 4204466.2\n",
      "ShipmentAmount_Port_of_Shanghai_Port_of_Haifa = 15820281.0\n",
      "ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali = 138667970.0\n",
      "ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz = 144102190.0\n",
      "ShipmentAmount_Port_of_St._Petersburg_Port_of_Haifa = 4536578.5\n",
      "ShipmentAmount_Port_of_Vancouver_Port_of_King_Abdul_Aziz = 363811.29\n",
      "ShipmentAmount_Port_of_Vladivostok_Port_of_Haifa = 9195220.1\n",
      "Total kilogram_miles = 2490068987005.9\n"
     ]
    }
   ],
   "source": [
    "prob.solve()\n",
    "\n",
    "print(\"Status:\", LpStatus[prob.status])\n",
    "\n",
    "for v in prob.variables():\n",
    "    if v.varValue > 0:\n",
    "        print(v.name, \"=\", v.varValue)\n",
    "\n",
    "print(\"Total kilogram_miles =\", value(prob.objective))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
